﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using SchoolLibrary.Entity.Person;
using SchoolLibrary.Entity;

namespace SchoolLibrary.DataBase.Builder
{
    public abstract class AbstractPersonBuilder : AbstractEntityBuilder
    {
        protected override void BuildEntity(Identity entity, DataRow row)
        {
            base.BuildEntity(entity, row);
            Person person = (Person)entity;
            person.Name = row[Person.NAME_COLUMN_NAME].ToString();
            person.MiddleName = row[Person.MIDDELE_NAME_COLUMN_NAME].ToString();
            person.Surname = row[Person.SURNAME_COLUMN_NAME].ToString();            
        }        
    }
}
